﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
    xmlns:dg="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.DataGrid;assembly=Sinacor.Infra.UI.Controls"
    xmlns:tk="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:tkp="clr-namespace:Microsoft.Windows.Controls.Primitives;assembly=WPFToolkit">

    <BooleanToVisibilityConverter x:Key="bool2VisibilityConverter" />
    <Controls:VisibilityToBooleanConverter x:Key="visibility2BoolConverter" />

    <Style x:Key="ControlDataGridSinacorTextBlock" TargetType="{x:Type Controls:SinacorTextBlock}">
        <Setter Property="Width" Value="Auto"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dg:DataGridCell}}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="3"/>
    </Style>

    <Style x:Key="ControlDataGridSinacorLabel" TargetType="{x:Type Controls:SinacorLabel}">
        <Setter Property="Width" Value="Auto"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dg:DataGridCell}}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="3"/>
    </Style>

    <!-- SelectAllButtonTemplate -->
    <ControlTemplate x:Key="SelectAllButtonTemplate" TargetType="{x:Type Button}">
        <Grid>
            <Rectangle x:Name="Border"
                 Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" 
                 SnapsToDevicePixels="True" />
            <Polygon x:Name="Arrow"
               HorizontalAlignment="Right"
               VerticalAlignment="Bottom"
               Margin="8,8,3,3"
               Opacity="0.15"
               Fill="Black"
               Stretch="Uniform"
               Points="0,10 10,10 10,0" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Arrow" Property="Visibility" Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- dg:SinacorDataGrid -->
    <Style x:Key="{x:Type dg:SinacorDataGrid}" TargetType="{x:Type dg:SinacorDataGrid}">
        <Setter Property="AutoGenerateColumns" Value="False" />
        <Setter Property="EnableColumnVirtualization" Value="True" />
        <Setter Property="CanUserResizeRows" Value="False" />
        <Setter Property="CanUserAddRows" Value="False" />
        <Setter Property="CanUserDeleteRows" Value="False" />
        <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
        <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="ColumnHeaderHeight" Value="22" />
        <Setter Property="RowHeight" Value="22" />
        <Setter Property="MinRowHeight" Value="22" />
        <Setter Property="RowHeaderWidth" Value="20" />
        <Setter Property="RowBackground" Value="Transparent" />
        <Setter Property="AlternationCount" Value="1" />
        <Setter Property="AlternatingRowBackground" Value="{DynamicResource BrushDataGridRowOddBackground}" />
        <Setter Property="GridLinesVisibility" Value="All" />
        <Setter Property="VerticalGridLinesBrush" Value="{DynamicResource BrushGridLine}" />
        <Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource BrushGridLine}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type dg:SinacorDataGrid}">
                    <Border Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          SnapsToDevicePixels="True"
                          Padding="{TemplateBinding Padding}">
                        <Border.ContextMenu>

                            <!-- DataGridContextMenu -->
                            <Controls:SinacorContextMenu x:Name="DataGridContextMenu">

                                <!-- ContextMenuTemplate -->
                                <StackPanel>
                                    <StackPanel.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding ContextMenuTemplate, RelativeSource={RelativeSource TemplatedParent}}" Value="{x:Null}">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </StackPanel.Style>
                                    <ContentPresenter ContentTemplate="{Binding ContextMenuTemplate, RelativeSource={RelativeSource TemplatedParent}}"
                                    ContentTemplateSelector="{Binding ContextMenuTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" />
                                    <Controls:SinacorContextMenuItemSeparator />
                                </StackPanel>

                                <!-- Navegação -->

                                <!-- SelectFirstItem -->
                                <Controls:SinacorContextMenuItem Header="{DynamicResource Infra.Controls.Label.IrParaPrimeiro}" Command="Controls:SelectionCommands.SelectFirstItem" CommandTarget="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" />
                                <!-- SelectLastItem -->
                                <Controls:SinacorContextMenuItem Header="{DynamicResource Infra.Controls.Label.IrParaUltimo}" Command="Controls:SelectionCommands.SelectLastItem" CommandTarget="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" />

                                <!-- Cópia para área de transferência -->
                                <StackPanel>
                                    <StackPanel.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsCopyableClipboard, RelativeSource={RelativeSource TemplatedParent}}" Value="False">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding IsEditing, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </StackPanel.Style>

                                    <Controls:SinacorContextMenuItemSeparator />
                                    <!-- Copy -->
                                    <Controls:SinacorContextMenuItem ContextMenuItemIcon="IconContextMenuCopy" Header="{DynamicResource Infra.Controls.Label.Copiar}" Command="ApplicationCommands.Copy" CommandTarget="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" />
                                    <!-- CopyAllClipboard -->
                                    <Controls:SinacorContextMenuItem ContextMenuItemIcon="IconContextMenuCopy" Header="{DynamicResource Infra.Controls.Label.CopiarTodos}" Command="Controls:ExportCommands.CopyAllClipboard" CommandTarget="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" />
                                </StackPanel>

                                <!-- Expotação para Excel -->
                                <StackPanel>
                                    <StackPanel.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsExportableExcel, RelativeSource={RelativeSource TemplatedParent}}" Value="False">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding IsEditing, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </StackPanel.Style>

                                    <Controls:SinacorContextMenuItemSeparator />
                                    <!-- ExportAllExcel -->
                                    <Controls:SinacorContextMenuItem ContextMenuItemIcon="IconContextMenuExcel" Header="{DynamicResource Infra.Controls.Label.ExportarExcel}" Command="Controls:ExportCommands.ExportAllExcel" CommandTarget="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" />
                                </StackPanel>
                                
                            </Controls:SinacorContextMenu>

                        </Border.ContextMenu>
                        <ScrollViewer Name="DG_ScrollViewer"
                            Focusable="false">
                            <ScrollViewer.Template>
                                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>

                                        <!--Left Column Header Corner -->
                                        <Button Command="{x:Static tk:DataGrid.SelectAllCommand}"
                                            Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}, Path=CellsPanelHorizontalOffset}"
                                            Template="{StaticResource SelectAllButtonTemplate}"
                                            Focusable="false"
                                            Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}, Path=HeadersVisibility, Converter={x:Static tk:DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static tk:DataGridHeadersVisibility.All}}" />
                                        <!--Column Headers-->
										<dg:DataGridColumnHeadersPresenter Grid.Column="1" 
                                                       Name="PART_ColumnHeadersPresenter"
                                                       Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}, Path=HeadersVisibility, Converter={x:Static tk:DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static tk:DataGridHeadersVisibility.Column}}">
											<dg:DataGridColumnHeadersPresenter.Template>
												<ControlTemplate TargetType="{x:Type dg:DataGridColumnHeadersPresenter}">
													<Grid Background="{DynamicResource gridControlBackgroundBrush}">
														<tk:DataGridColumnHeader IsHitTestVisible="False" Background="{DynamicResource gridControlBackgroundBrush}" />
														<ItemsPresenter/>
													</Grid>
												</ControlTemplate>
											</dg:DataGridColumnHeadersPresenter.Template>
										</dg:DataGridColumnHeadersPresenter>

										<!--DataGrid content-->
                                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Grid.Row="1" Grid.ColumnSpan="2" CanContentScroll="{TemplateBinding CanContentScroll}" />

                                        <Controls:SinacorVerticalScrollBar Grid.Row="1" Grid.Column="2" Name="PART_VerticalScrollBar"
                                             Orientation="Vertical"
                                             Maximum="{TemplateBinding ScrollableHeight}"
                                             ViewportSize="{TemplateBinding ViewportHeight}"
                                             Value="{Binding Path=VerticalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
                                             Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>

                                        <Grid Grid.Row="2" Grid.Column="1">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}, Path=NonFrozenColumnsViewportHorizontalOffset}"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Controls:SinacorHorizontalScrollBar Grid.Column="1"
                                                 Name="PART_HorizontalScrollBar"
                                                 Orientation="Horizontal"
                                                 Maximum="{TemplateBinding ScrollableWidth}"
                                                 ViewportSize="{TemplateBinding ViewportWidth}"
                                                 Value="{Binding Path=HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
                                                 Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>

                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ScrollViewer.Template>
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- dg:DataGridRow -->
    <Style x:Key="{x:Type dg:DataGridRow}" TargetType="{x:Type dg:DataGridRow}">
        <Setter Property="VerticalAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type dg:SinacorDataGrid}}}" />
        <Setter Property="HorizontalAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type dg:SinacorDataGrid}}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type dg:DataGridRow}">
                    <Border x:Name="DGR_Border"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        SnapsToDevicePixels="True">
                        <tkp:SelectiveScrollingGrid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <!-- Substitui o DataGridCellsPresenter original pelo do sinacor, para gerar as células do sinacor -->
                            <dg:DataGridCellsPresenter Grid.Column="1" 
                                ItemsPanel="{TemplateBinding ItemsPanel}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

                            <tkp:DataGridDetailsPresenter  tkp:SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}, Path=AreRowDetailsFrozen, Converter={x:Static tk:DataGrid.RowDetailsScrollingConverter}, ConverterParameter={x:Static tk:SelectiveScrollingOrientation.Vertical}}"
                                Grid.Column="1" Grid.Row="1"
                                Visibility="{TemplateBinding DetailsVisibility}" />

                            <tkp:DataGridRowHeader tkp:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Grid.RowSpan="2"
                                Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}, Path=HeadersVisibility, Converter={x:Static tk:DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static tk:DataGridHeadersVisibility.Row}}"/>
                        </tkp:SelectiveScrollingGrid>
                    </Border>
                    <ControlTemplate.Triggers>
                        
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" Value="{DynamicResource BrushDataGridRowSelectedBackground}" />
                        </Trigger>
                        
                        <Trigger Property="Controls:SinacorDragDrop.IsDragOver" Value="True">
                            <Setter Property="Background" Value="{DynamicResource BrushDataGridRowSelectedBackground}" />
                        </Trigger>
                        
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- dg:DataGridCell -->
    <Style x:Key="{x:Type dg:DataGridCell}" TargetType="{x:Type dg:DataGridCell}">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource BrushLabelForeground}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding Column.VerticalCellAlignment, RelativeSource={RelativeSource Self}}" />
        <Setter Property="HorizontalContentAlignment" Value="{Binding Column.HorizontalCellAlignment, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type dg:DataGridCell}">
                    <Border x:Name="PART_Border"
                        Background="{TemplateBinding Background}" 
                        BorderBrush="{TemplateBinding BorderBrush}"  
                        BorderThickness="{TemplateBinding BorderThickness}" 
                        SnapsToDevicePixels="True"
                        Padding="{TemplateBinding Padding}">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>

            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter Property="Background" Value="{DynamicResource BrushDataGridCellCurrentBackground}" />
            </Trigger>

        </Style.Triggers>
    </Style>

    <!-- ColumnHeaderGripperStyle -->
    <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- dg:DataGridColumnHeader -->
    <Style x:Key="{x:Type dg:DataGridColumnHeader}" TargetType="{x:Type dg:DataGridColumnHeader}">
        <Setter Property="Background" Value="{DynamicResource BrushGridCellHeaderBackground}" />
        <Setter Property="BorderThickness" Value="0,0,0,1" />
        <Setter Property="BorderBrush" Value="{DynamicResource BrushGridLine}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type dg:DataGridColumnHeader}">
                    <Grid>
                        <Grid.ContextMenu>

                            <Controls:SinacorContextMenu x:Name="ColumnManagerCellContextMenu">
                                <StackPanel x:Name="ShowHideColumnsPanel">
                                    <StackPanel.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <!-- Esconde exibir/ocultar colunas se estiver editando -->
                                                <!--<DataTrigger Binding="{Binding Column.DataGrid.IsEditing, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>-->

                                                <!-- Esconde exibir/ocultar colunas se nenhuma visibilidade puder ser alterada -->
                                                <DataTrigger Binding="{Binding Column.DataGrid.ChangeVisibilityColumns.IsEmpty, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                                                    <Setter Property="UIElement.Visibility" Value="Collapsed" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </StackPanel.Style>
                                    <Controls:SinacorScrollViewer Width="Auto" Height="Auto" MinWidth="180" MaxWidth="250" MaxHeight="300" Margin="7"
                                          VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                                        <ItemsControl ItemsSource="{Binding Column.DataGrid.ChangeVisibilityColumns, RelativeSource={RelativeSource TemplatedParent}}">
                                            <ItemsControl.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <StackPanel Orientation="Vertical" IsItemsHost="True" />
                                                </ItemsPanelTemplate>
                                            </ItemsControl.ItemsPanel>
                                            <ItemsControl.ItemTemplate>
                                                <DataTemplate>
                                                    <Controls:SinacorCheckBox Name="chkColumn"
                                                      Content="{Binding Header}"
                                                      IsChecked="{Binding Visibility, Converter={StaticResource visibility2BoolConverter}}"
                                                      ContentStringFormat="{Binding HeaderStringFormat}"
                                                      ContentTemplate="{Binding HeaderTemplate}"
                                                      ContentTemplateSelector="{Binding HeaderTemplateSelector}"
                                                      Style="{DynamicResource ControlCheckBoxDarkBackground}" />
                                                    <DataTemplate.Triggers>
                                                        <MultiDataTrigger>
                                                            <MultiDataTrigger.Conditions>
                                                                <Condition Binding="{Binding DataGrid.CanHideColumn}" Value="False" />
                                                                <Condition Binding="{Binding Visibility}" Value="Visible" />
                                                            </MultiDataTrigger.Conditions>
                                                            <MultiDataTrigger.Setters>
                                                                <Setter Property="IsEnabled" Value="False" TargetName="chkColumn" />
                                                            </MultiDataTrigger.Setters>
                                                        </MultiDataTrigger>
                                                    </DataTemplate.Triggers>
                                                </DataTemplate>
                                            </ItemsControl.ItemTemplate>
                                        </ItemsControl>
                                    </Controls:SinacorScrollViewer>
                                </StackPanel>

                            </Controls:SinacorContextMenu>

                        </Grid.ContextMenu>

                        <tk:DataGridHeaderBorder SortDirection="{TemplateBinding SortDirection}"
                                     IsHovered="{TemplateBinding IsMouseOver}"
                                     IsPressed="{TemplateBinding IsPressed}"
                                     IsClickable="{TemplateBinding CanUserSort}"
                                     Background="{TemplateBinding Background}"
                                     BorderBrush="{TemplateBinding BorderBrush}"
                                     BorderThickness="{TemplateBinding BorderThickness}"
                                     Padding ="{TemplateBinding Padding}"
                                     SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
                                     SeparatorBrush="{TemplateBinding SeparatorBrush}">

                            <StackPanel 
                                HorizontalAlignment="Center"
                                Orientation="Horizontal">
                                <Grid>
                                    <!-- Conteúdo do cabeçalho -->
                                    <ContentPresenter 
                                        Margin="15,0,0,0" 
                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"                                                     
                                        Style="{DynamicResource ControlFont}" 
                                        TextElement.Foreground="{DynamicResource BrushControlDataGridTitleTextBlock}">
                                    </ContentPresenter>
                                </Grid>
                                <Grid Width="15">
                                    <!-- Seta de ordenação -->
                                    <Path x:Name="PART_SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" 
                                        Width="9" Height="5" Fill="{DynamicResource BrushControlDataGridTitleTextBlock}" Margin="0" 
                                        VerticalAlignment="Center" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" />
                                </Grid>
                            </StackPanel>
                        </tk:DataGridHeaderBorder>

                        <Thumb x:Name="PART_LeftHeaderGripper"
                            HorizontalAlignment="Left"
                            Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper"
                            HorizontalAlignment="Right"
                            Style="{StaticResource ColumnHeaderGripperStyle}"/>

                        <!-- Separador das colunas -->
                        <Rectangle Fill="{DynamicResource BrushResizerRectangle}"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Stretch"
                           Width="1"
                           Margin="0"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- Esconde o menu se os dois paineis estiverem ocultos -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Visibility" Value="Collapsed" SourceName="ShowHideColumnsPanel" />
                                <!--<Condition Property="Visibility" Value="Collapsed" SourceName="UnfreezeColumnsPanel" />-->
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ColumnManagerCellContextMenu" />
                        </MultiTrigger>

                        <!-- Esconde o separador se um dos paineis estiver oculto -->
                        <!--<Trigger Property="Visibility" Value="Collapsed" SourceName="ShowHideColumnsPanel">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Separator" />
                        </Trigger>
                        <Trigger Property="Visibility" Value="Collapsed" SourceName="UnfreezeColumnsPanel">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Separator" />
                        </Trigger>-->

                        <!-- MouseOver 
                            Só deve exibir estilo de mouse over se usuário puder ordenar ou trocar ordem das colunas
                        -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="CanUserSort" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter Property="Background" Value="{DynamicResource BrushGridCellHeaderBackgroundHover}" />
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Column.CanUserReorder, RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="Background" Value="{DynamicResource BrushGridCellHeaderBackgroundHover}" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!-- Pressed 
                            Só deve exibir estilo de pressed se usuário puder ordenar ou trocar ordem das colunas
                        -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsPressed" Value="True" />
                                <Condition Property="CanUserSort" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter Property="Background" Value="{DynamicResource BrushGridCellHeaderBackgroundPressed}" />
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Column.CanUserReorder, RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="Background" Value="{DynamicResource BrushGridCellHeaderBackgroundPressed}" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!-- Exibe a seta de ordenação -->
                        <Trigger Property="SortDirection" Value="Ascending">
                            <Setter TargetName="PART_SortArrow" Property="Visibility" Value="Visible" />
                            <Setter TargetName="PART_SortArrow" Property="RenderTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="180" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="SortDirection" Value="Descending">
                            <Setter TargetName="PART_SortArrow" Property="Visibility" Value="Visible" />
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- RowHeaderGripperStyle -->
    <Style x:Key="RowHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Height" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeNS"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
                  Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- tkp:DataGridRowHeader -->
    <Style x:Key="{x:Type tkp:DataGridRowHeader}" TargetType="{x:Type tkp:DataGridRowHeader}">
        <Setter Property="Background" Value="{DynamicResource BrushRowHeaderBackground}" />
        <Setter Property="BorderThickness" Value="0,0,1,0" />
        <Setter Property="BorderBrush" Value="{DynamicResource BrushGridLine}" />
        <Setter Property="ClickMode" Value="Release" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type tkp:DataGridRowHeader}">
                    <Grid>
                        <tk:DataGridHeaderBorder IsSelected="{TemplateBinding IsRowSelected}"
                                     IsHovered ="{TemplateBinding IsMouseOver}"
                                     IsPressed="{TemplateBinding IsPressed}"
                                     Background="{TemplateBinding Background}"
                                     BorderBrush="{TemplateBinding BorderBrush}"
                                     BorderThickness="{TemplateBinding BorderThickness}"
                                     Padding ="{TemplateBinding Padding}"
                                     Orientation="Horizontal"
                                     SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
                                     SeparatorBrush="{TemplateBinding SeparatorBrush}">
                            <Grid>
                                <Border Name="rootBorder">
                                    <Grid>
                                        <Grid>
                                            <Path x:Name="PART_Arrow"  Visibility="Collapsed" Width="8"   Height="7" Stretch="Fill" Fill="#FF0033FF" Data="F1 M -3.05176e-005,2.1265L 3.11682,2.1265L 3.11682,0L 8.13379,3.54236L 3.11682,7.08475L 3.11682,5.1265L -3.05176e-005,5.1265L -3.05176e-005,2.1265 Z "                                                                                                           HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
                                            <Path x:Name="PART_New"    Visibility="Collapsed" Width="6"   Height="7" Stretch="Fill" Fill="#FF0FA900" Data="F1 M 5.69336,6.81332L 4.02939,6.81332L 1.58667,2.06354L 1.58667,6.81332L 0,6.81332L 0,0L 2.08545,0L 4.10669,3.90247L 4.10669,0L 5.69336,0L 5.69336,6.81332 Z "                                                                                                   HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
                                            <Path x:Name="PART_Change" Visibility="Collapsed" Width="3"   Height="8" Stretch="Fill" Fill="#FFFF8B00" Data="M0,6.2266259 L2.2163616,6.2266259 2.2163616,7.9545064 0,7.9545064 0,6.1253073 z M0,0 L2.2163616,0 2.2163616,5.3243072 0,5.3243072 0,0 z"                                                                                                                         HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
                                            <Path x:Name="PART_Delete" Visibility="Collapsed" Width="6.5" Height="7" Stretch="Fill" Fill="#FF990000" Data="F1 M 6.53339,6.81329L 4.54712,6.81329L 3.2171,4.77747L 2.00085,6.81329L 0,6.81329L 2.27063,3.32935L 0.0933533,0L 2.07959,0L 3.26376,1.97455L 4.43918,0L 6.44003,0L 4.26422,3.33954L 6.53339,6.81329 Z "                                                          HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
                                            <Path x:Name="PART_Error"  Visibility="Collapsed" Width="5"   Height="7" Stretch="Fill" Fill="#FFFF3300" Data="M0.80797368,2.9375925 L6.0912819,2.9375925 L6.0912819,4.4276218 L2.7597022,4.4276218 L2.7597022,5.7969794 L5.8289528,5.7969794 L5.8289528,7.2870088 L2.7597022,7.2870088 L2.7597022,9.2597237 L6.0912819,9.2597237 L6.0912819,10.749753 L0.80797368,10.749753 z" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
                                            <!--<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                                            <Control SnapsToDevicePixels="false"
                                                Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGridRow}}, Path=(Validation.HasError), Converter={StaticResource bool2VisibilityConverter}}"
                                                Template="{Binding RelativeSource={RelativeSource AncestorType={x:Type tk:DataGridRow}}, Path=ValidationErrorTemplate}" />-->
                                        </Grid>
                                        <Border BorderThickness="1,1,0,0" Name="isPressedDarkInnerHighlight">
                                            <Border BorderThickness="1,1,0,0" Name="isPressedLightInnerHighlight" />
                                        </Border>
                                    </Grid>
                                </Border>

                                <Border Name="selectedMouseOverRightBorder" Width="4" Background="{DynamicResource RowSelectorBorder}" HorizontalAlignment="Right" Visibility="Collapsed">
                                    <Border Width="4" 
                                            Height="{Binding RowHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dg:SinacorDataGrid}}}" 
                                            MinHeight="{Binding MinRowHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dg:SinacorDataGrid}}}"
                                            VerticalAlignment="Center">
                                        <Border.Background>
                                            <DrawingBrush Viewbox="0,0,3,22" ViewboxUnits="Absolute">
                                                <DrawingBrush.Drawing>
                                                    <DrawingGroup>
                                                        <GeometryDrawing Brush="{DynamicResource GeometricDrawing1}">
                                                            <GeometryDrawing.Geometry>
                                                                <RectangleGeometry RadiusX="0" RadiusY="0" Rect="0,0,3,22"/>
                                                            </GeometryDrawing.Geometry>
                                                        </GeometryDrawing>
                                                        <DrawingGroup>
                                                            <DrawingGroup.Transform>
                                                                <MatrixTransform Matrix="1,0,0,1,0.338,8.66"/>
                                                            </DrawingGroup.Transform>
                                                            <GeometryDrawing Brush="{DynamicResource GeometricDrawing2}" Geometry="M5.8195542E-06,0 L5.8195542E-06,6.0829962 2.5819994,3.0476747 z"/>
                                                        </DrawingGroup>
                                                        <DrawingGroup>
                                                            <DrawingGroup.Transform>
                                                                <MatrixTransform Matrix="1,0,0,1,0.218,7.92"/>
                                                            </DrawingGroup.Transform>
                                                            <GeometryDrawing Brush="{DynamicResource GeometricDrawing3}" Geometry="M5.8195542E-06,0 L5.8195542E-06,6.0829962 2.5819994,3.0476747 z"/>
                                                        </DrawingGroup>
                                                    </DrawingGroup>
                                                </DrawingBrush.Drawing>
                                            </DrawingBrush>
                                        </Border.Background>
                                    </Border>
                                </Border>

                                <Border Name="selectedRightBorder" Width="4" Background="{DynamicResource RowSelectorRightBorder}" HorizontalAlignment="Right" Visibility="Collapsed">
                                    <Border Width="4" 
                                            Height="{Binding RowHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dg:SinacorDataGrid}}}" 
                                            MinHeight="{Binding MinRowHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type dg:SinacorDataGrid}}}"
                                            VerticalAlignment="Center">
                                        <Border.Background>
                                            <DrawingBrush Viewbox="0,0,3,22" ViewboxUnits="Absolute">
                                                <DrawingBrush.Drawing>
                                                    <DrawingGroup>
                                                        <GeometryDrawing Brush="{DynamicResource GeometricDrawing4}">
                                                            <GeometryDrawing.Geometry>
                                                                <RectangleGeometry RadiusX="0" RadiusY="0" Rect="0,0,3,22"/>
                                                            </GeometryDrawing.Geometry>
                                                        </GeometryDrawing>
                                                        <DrawingGroup>
                                                            <DrawingGroup.Transform>
                                                                <MatrixTransform Matrix="1,0,0,1,0.338,8.66"/>
                                                            </DrawingGroup.Transform>
                                                            <GeometryDrawing Brush="{DynamicResource GeometricDrawing5}" Geometry="M5.8195542E-06,0 L5.8195542E-06,6.0829962 2.5819994,3.0476747 z"/>
                                                        </DrawingGroup>
                                                        <DrawingGroup>
                                                            <DrawingGroup.Transform>
                                                                <MatrixTransform Matrix="1,0,0,1,0.218,7.92"/>
                                                            </DrawingGroup.Transform>
                                                            <GeometryDrawing Brush="{DynamicResource GeometricDrawing6}" Geometry="M5.8195542E-06,0 L5.8195542E-06,6.0829962 2.5819994,3.0476747 z"/>
                                                        </DrawingGroup>
                                                    </DrawingGroup>
                                                </DrawingBrush.Drawing>
                                            </DrawingBrush>
                                        </Border.Background>
                                    </Border>
                                </Border>

                                <Rectangle Fill="{DynamicResource Rectangle1}" Name="topBorder" Height="1" Margin="3,0,4,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                                <Rectangle Fill="{DynamicResource Rectangle2}" Name="bottomBorder" Height="1" Margin="3,0,4,0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />

                            </Grid>
                        </tk:DataGridHeaderBorder>

                        <Thumb x:Name="PART_TopHeaderGripper"
                           VerticalAlignment="Top"
                           Style="{StaticResource RowHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_BottomHeaderGripper"
                           VerticalAlignment="Bottom"
                           Style="{StaticResource RowHeaderGripperStyle}"/>
                    </Grid>

                    <ControlTemplate.Triggers>

                        <!-- Pressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Panel.Background" TargetName="rootBorder" Value="{DynamicResource Trigger1}" />
                            <Setter Property="Border.BorderBrush" TargetName="rootBorder" Value="{DynamicResource Trigger2}"/>
                            <Setter Property="Border.BorderThickness" TargetName="rootBorder">
                                <Setter.Value>
                                    <Thickness>0,1,1,1</Thickness>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="UIElement.Visibility" TargetName="selectedMouseOverRightBorder">
                                <Setter.Value>
                                    <x:Static Member="Visibility.Hidden" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="UIElement.Visibility" TargetName="selectedRightBorder">
                                <Setter.Value>
                                    <x:Static Member="Visibility.Hidden" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Border.BorderBrush" TargetName="isPressedLightInnerHighlight" Value="{DynamicResource Trigger3}"/>
                            <Setter Property="Border.BorderBrush" TargetName="isPressedDarkInnerHighlight" Value="{DynamicResource Trigger4}"/>
                        </Trigger>

                        <!-- Mouse over da linha selecionada -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="False" />
                                <Condition Binding="{Binding IsRowSelected, RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="selectedRightBorder" />
                            <Setter Property="Background" Value="{DynamicResource Trigger5}" TargetName="rootBorder" />
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding IsRowSelected, RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="selectedMouseOverRightBorder" />
                        </MultiDataTrigger>

                        <!-- Arrow -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType={x:Type dg:DataGridRow}}}" Value="True" />
                                <Condition Binding="{Binding State}" Value="Unchanged" />
                                <Condition Binding="{Binding HasErrors}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Arrow" />
                        </MultiDataTrigger>

                        <!--<MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding DataContext.State}" Value="Inserted" />
                                <Condition Binding="{Binding DataContext.HasErrors}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_New" />
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding DataContext.State}" Value="Updated" />
                                <Condition Binding="{Binding DataContext.HasErrors}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Change" />
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding DataContext.State}" Value="Deleted" />
                                <Condition Binding="{Binding DataContext.HasErrors}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Delete" />
                        </MultiDataTrigger>
                        <DataTrigger Binding="{Binding DataContext.HasErrors}" Value="True">
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Error" />
                        </DataTrigger>-->

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Row Styles -->
    <Style x:Key="DataGridRowBusiness01" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness01}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness02" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness02}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness03" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness03}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness04" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness04}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness05" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness05}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness06" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness06}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness07" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness07}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness08" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness08}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness09" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness09}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness10" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness10}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness11" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness11}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness12" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness12}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness13" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness13}" />
            </Style>
        </Style.Resources>
    </Style>
    <Style x:Key="DataGridRowBusiness14" TargetType="{x:Type dg:DataGridRow}" BasedOn="{StaticResource {x:Type dg:DataGridRow}}">
        <Style.Resources>
            <Style TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
                <Setter Property="Foreground" Value="{DynamicResource BrushGridRowBusiness14}" />
            </Style>
        </Style.Resources>
    </Style>

    <!-- Cell Styles -->
    <Style x:Key="DataGridCellBusiness01" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness01}" />
    </Style>
    <Style x:Key="DataGridCellBusiness02" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness02}" />
    </Style>
    <Style x:Key="DataGridCellBusiness03" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness03}" />
    </Style>
    <Style x:Key="DataGridCellBusiness04" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness04}" />
    </Style>
    <Style x:Key="DataGridCellBusiness05" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness05}" />
    </Style>
    <Style x:Key="DataGridCellBusiness06" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness06}" />
    </Style>
    <Style x:Key="DataGridCellBusiness07" TargetType="{x:Type dg:DataGridCell}" BasedOn="{StaticResource {x:Type dg:DataGridCell}}">
        <Setter Property="Foreground" Value="{DynamicResource BrushGridCellBusiness07}" />
    </Style>

</ResourceDictionary>
